Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anchor-less if and each blocks #512

Merged
merged 8 commits into from
Apr 25, 2017
Merged

Anchor-less if and each blocks #512

merged 8 commits into from
Apr 25, 2017

Conversation

Rich-Harris
Copy link
Member

One of the oldest issues — #3. In situations where an if-block or each-block is immediately followed by a DOM node (element, text, or [raw] mustache tag), there's no need to create a comment just to anchor the block to the right location in the DOM; we can just use the following element. The same is true if the block is the last thing inside an element.

Now that we're doing two passes over the markup AST this is reasonably straightforward — we just need to give each DOM node a name in advance, so that on the second pass an if-block or each-block can easily determine whether or not it needs to create a comment node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants